﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using System.Web.UI.HtmlControls;

public partial class Admin_ImgNews : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DataTable dt = ImgNewsDataDBOption.DataTableSelect();
            StringBuilder sb = new StringBuilder();
            int i=0;
            foreach (DataRow dr in dt.Rows)
            {
                sb.Append("<tr>");
                sb.Append(System.Environment.NewLine);
                sb.Append("<td>");
                sb.Append(System.Environment.NewLine);
                    DateTime t=Convert.ToDateTime(dr["EditDate"].ToString());
                    sb.Append(t.ToString("yyyy/MM/dd"));
                    sb.Append(System.Environment.NewLine);
                sb.Append("</td>");
                sb.Append(System.Environment.NewLine);

                sb.Append("<td>");
                sb.Append(System.Environment.NewLine);
                    sb.Append(dr["Title"].ToString());
                    sb.Append(System.Environment.NewLine);
                sb.Append("</td>");
                sb.Append(System.Environment.NewLine);

                sb.Append("<td>");
                sb.Append(System.Environment.NewLine);
                    sb.Append(" <a href=\"ImgNewsEdit.aspx?");
                    sb.Append(dr["ID"].ToString());
                    sb.Append("\" title=\"\"><img src=\"img/icons/icon_edit.png\" alt=\"Edit\" /></a>");
                    sb.Append(System.Environment.NewLine);


                    sb.Append(" <a href=\"#?Top&");
                    sb.Append(dr["ID"].ToString());
                    sb.Append("\" title=\"\"><img src=\"img/icons/icon_approve.png\" alt=\"Edit\" /></a>");
                    sb.Append(System.Environment.NewLine);

                    sb.Append(" <a href=\"ImgNewsEdit.aspx");
                    sb.Append("\" title=\"\"><img src=\"img/icons/icon_unapprove.png\" alt=\"Unapprove\" /></a>");
                    sb.Append(System.Environment.NewLine);    

                    sb.Append(" <a href=\"#?Del&");
                    sb.Append(dr["ID"].ToString());
                    sb.Append("\" title=\"\" onclick=\"javascript:return p_del()\"><img src=\"img/icons/icon_delete.png\" alt=\"Edit\" /></a>");
                    sb.Append(System.Environment.NewLine);                    
                sb.Append("</td>");
                sb.Append(System.Environment.NewLine);
                
                sb.Append("<td>");
                sb.Append(System.Environment.NewLine);
                sb.Append("<input type=\"checkbox\" value=\"\" name=\"checkall\" id=\"ck");
                    sb.Append(i++.ToString());
                    sb.Append("_");
                    sb.Append(dr["ID"].ToString());
                    sb.Append("\" />");
                    sb.Append(System.Environment.NewLine);
                sb.Append("</td>");  
                sb.Append(System.Environment.NewLine);          
            }
            ImgNewsTableLiteral.Text = sb.ToString();
        }
    }
    protected void Top_Click(object sender, ImageClickEventArgs e)
    {

    }
    protected void Del_Click(object sender, ImageClickEventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        
    }
}